import 'package:flutter2/generated/json/base/json_convert_content.dart';
import 'package:flutter2/model/bank_card_entity.dart';

BankCardEntity $BankCardEntityFromJson(Map<String, dynamic> json) {
  final BankCardEntity bankCardEntity = BankCardEntity();
  final String? bankTypeDesc = jsonConvert.convert<String>(json['p']);
  if (bankTypeDesc != null) {
    bankCardEntity.bankTypeDesc = bankTypeDesc;
  }
  final String? birth = jsonConvert.convert<String>(json['workertour']);
  if (birth != null) {
    bankCardEntity.birth = birth;
  }
  final String? bankCode = jsonConvert.convert<String>(json['shutcard']);
  if (bankCode != null) {
    bankCardEntity.bankCode = bankCode;
  }
  final String? bankType = jsonConvert.convert<String>(json['waistsymphonypercentage']);
  if (bankType != null) {
    bankCardEntity.bankType = bankType;
  }
  final String? bankName = jsonConvert.convert<String>(json['protectionsuckmemory']);
  if (bankName != null) {
    bankCardEntity.bankName = bankName;
  }
  final String? no = jsonConvert.convert<String>(json['candidatestraightforward']);
  if (no != null) {
    bankCardEntity.no = no;
  }
  final String? email = jsonConvert.convert<String>(json['scientistworriedengland']);
  if (email != null) {
    bankCardEntity.email = email;
  }
  final String? id = jsonConvert.convert<String>(json['gamecrossconduct']);
  if (id != null) {
    bankCardEntity.id = id;
  }
  return bankCardEntity;
}

Map<String, dynamic> $BankCardEntityToJson(BankCardEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['p'] = entity.bankTypeDesc;
  data['workertour'] = entity.birth;
  data['shutcard'] = entity.bankCode;
  data['waistsymphonypercentage'] = entity.bankType;
  data['protectionsuckmemory'] = entity.bankName;
  data['candidatestraightforward'] = entity.no;
  data['scientistworriedengland'] = entity.email;
  data['gamecrossconduct'] = entity.id;
  return data;
}

extension BankCardEntityExtension on BankCardEntity {
  BankCardEntity copyWith({
    String? bankTypeDesc,
    String? birth,
    String? bankCode,
    String? bankType,
    String? bankName,
    String? no,
    String? email,
    String? id,
  }) {
    return BankCardEntity()
      ..bankTypeDesc = bankTypeDesc ?? this.bankTypeDesc
      ..birth = birth ?? this.birth
      ..bankCode = bankCode ?? this.bankCode
      ..bankType = bankType ?? this.bankType
      ..bankName = bankName ?? this.bankName
      ..no = no ?? this.no
      ..email = email ?? this.email
      ..id = id ?? this.id;
  }
}
